export default class SelectedWidgets {
  constructor(widgets = []) {
    this.widgets = widgets
  }
  setWidgets(widgets) {
    this.widgets = widgets
  }
  addComp(widget) {
    this.widgets.push(widget)
  }
  createHtml(id, editting, dragController) {
    const {
      formPropsController
    } = dragController
    console.log(formPropsController)
    return editting ?
      `<div id=${id}>
        ${
          this.widgets.reduce((result, widget, index) => {
            return result += widget.createWidgetHtml(index, editting)
          }, "")
        }
      </div>` :
      `<el-form inline :model="formData" :rules="rules" ref="ultrameForm">
        ${
          this.widgets.reduce((result, widget, index) => {
            return result += widget.createWidgetHtml(index, editting)
          }, "")
        }
      </el-form>`
  }
}